package com.jie.langlangmall.controller;

import com.jie.langlangmall.common.api.CommonResult;
import com.jie.langlangmall.model.OmsOrderSetting;
import com.jie.langlangmall.service.OmsOrderSettingService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author Jie
 * @Date 2024/11/28
 * @Email 3217998214@qq.com
 * @Description 订单设置管理C
 */
@RestController
@Tag(name = "OmsOrderSettingController", description = "订单设置管理")
@RequestMapping("/orderSetting")
public class OmsOrderSettingController {

    @Autowired
    private OmsOrderSettingService orderSettingService;

    @Operation(summary = "获取指定订单设置")
    @GetMapping("/{id}")
    public CommonResult<OmsOrderSetting> getItem(@PathVariable Long id) {
        OmsOrderSetting orderSetting = orderSettingService.getItem(id);
        return CommonResult.success(orderSetting);
    }

    @Operation(summary = "修改指定订单设置")
    @PostMapping("/update/{id}")
    public CommonResult<?> update(@PathVariable Long id, @RequestBody OmsOrderSetting orderSetting) {
        orderSettingService.update(id, orderSetting);
        return CommonResult.success();
    }

}
